<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Mali OpenCL SDK v1.1.0: /home/jenkins/workspace/opencl_sdk_daily/Architecture/x86/OS/linux/common/image.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Mali OpenCL SDK v1.1.0
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Help&#160;and&#160;Tutorials</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('image_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">image.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="image_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This confidential and proprietary software may be used only as</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * authorised by a licensing agreement from ARM Limited</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *   (C) COPYRIGHT 2013 ARM Limited</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *       ALL RIGHTS RESERVED</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * The entire notice above must be reproduced on all authorised</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * copies and copies may only be made to the extent permitted</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * by a licensing agreement from ARM Limited.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#ifndef IMAGE_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define IMAGE_H</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;CL/cl.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="code" href="structbitmap_magic.html">   26</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structbitmap_magic.html" title="Bitmap magic file header numbers.">bitmapMagic</a></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;{</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="code" href="structbitmap_magic.html#a477646205ecad5019613626f0b478694">   28</a></span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structbitmap_magic.html#a477646205ecad5019613626f0b478694">magic</a>[2];</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;};</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="structbitmap_header.html">   35</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structbitmap_header.html" title="Bitmap header.">bitmapHeader</a></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;{</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="structbitmap_header.html#ad06f4dbac80aa4d85163d3862ed34197">   37</a></span>&#160;  uint32_t <a class="code" href="structbitmap_header.html#ad06f4dbac80aa4d85163d3862ed34197" title="Total size of the bitmap in bytes.">fileSize</a>; </div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="structbitmap_header.html#ad1281577a12cb4314cfe869877135231">   38</a></span>&#160;  uint16_t <a class="code" href="structbitmap_header.html#ad1281577a12cb4314cfe869877135231" title="Reserved field which can be application defined.">creator1</a>; </div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="structbitmap_header.html#aafdafe00204ad8448ab9cd98aa3040b2">   39</a></span>&#160;  uint16_t <a class="code" href="structbitmap_header.html#aafdafe00204ad8448ab9cd98aa3040b2" title="Reserved field which can be application defined.">creator2</a>; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="structbitmap_header.html#a5e74a0bfe6340ad581369b48bce59dbe">   40</a></span>&#160;  uint32_t <a class="code" href="structbitmap_header.html#a5e74a0bfe6340ad581369b48bce59dbe" title="Offset in bytes to the beginning of the image data block.">offset</a>; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;};</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html">   47</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structbitmap_information_header.html" title="Bitmap information header.">bitmapInformationHeader</a></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;{</div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#afd30cb5246210713920211afb56f13f0">   49</a></span>&#160;  uint32_t <a class="code" href="structbitmap_information_header.html#afd30cb5246210713920211afb56f13f0">size</a>; </div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#abb2a108b489900502eb06b3982b0dc02">   50</a></span>&#160;  int32_t <a class="code" href="structbitmap_information_header.html#abb2a108b489900502eb06b3982b0dc02">width</a>; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#a5c5209b385872825e8f9c629ac288a12">   51</a></span>&#160;  int32_t <a class="code" href="structbitmap_information_header.html#a5c5209b385872825e8f9c629ac288a12">height</a>; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#a92ce2fb0499b65ccb0dccbec12b44c4c">   52</a></span>&#160;  uint16_t <a class="code" href="structbitmap_information_header.html#a92ce2fb0499b65ccb0dccbec12b44c4c">numberOfColorPlanes</a>; </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#ae25aec64837eed48f745ae7728af7dff">   53</a></span>&#160;  uint16_t <a class="code" href="structbitmap_information_header.html#ae25aec64837eed48f745ae7728af7dff">bitsPerPixel</a>; </div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#a1a6659ee7987cc1be662ec93a6f2eef7">   54</a></span>&#160;  uint32_t <a class="code" href="structbitmap_information_header.html#a1a6659ee7987cc1be662ec93a6f2eef7">compressionType</a>; </div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#abd9001c6c1eefbef9c53f15ec6f3162a">   55</a></span>&#160;  uint32_t <a class="code" href="structbitmap_information_header.html#abd9001c6c1eefbef9c53f15ec6f3162a">rawBitmapSize</a>; </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#a39272c25c46f5628cdefc3965f4f6e0d">   56</a></span>&#160;  int32_t <a class="code" href="structbitmap_information_header.html#a39272c25c46f5628cdefc3965f4f6e0d">horizontalResolution</a>; </div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#a9596ce6332941aafbbf85b7e379e948f">   57</a></span>&#160;  int32_t <a class="code" href="structbitmap_information_header.html#a9596ce6332941aafbbf85b7e379e948f">verticalResolution</a>; </div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#ab8a3e77e6b66d1361d65523a99104f5f">   58</a></span>&#160;  uint32_t <a class="code" href="structbitmap_information_header.html#ab8a3e77e6b66d1361d65523a99104f5f">numberOfColors</a>; </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="structbitmap_information_header.html#aa6296b037bae6831a6c53f6115c29769">   59</a></span>&#160;  uint32_t <a class="code" href="structbitmap_information_header.html#aa6296b037bae6831a6c53f6115c29769">numberOfImportantColors</a>; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;};</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="image_8cpp.html#ad7fed8ed5795a8ddd3e86265cc5a4d31">saveToBitmap</a>(std::string filename, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* imageData);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="image_8cpp.html#a24ebc43a2f3d72aff84912a1a69f2c39">loadFromBitmap</a>(std::string filename, <span class="keywordtype">int</span>* width, <span class="keywordtype">int</span>* height, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> **imageData);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="image_8cpp.html#a9390e4ddc634d83452a15e93017ab979" title="Convert 8-bits per pixel luminance data to 24-bits per pixel RGB data.">luminanceToRGB</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* luminanceData, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* rgbData, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height);</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="image_8cpp.html#a75fa143dccc45f3d5dc030884ca09cc9" title="Convert 24-bits per pixel RGB data to 8-bits per pixel luminance data.">RGBToLuminance</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* rgbData, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* luminanceData, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="image_8cpp.html#a83b7aea3d44c26db2222227c0dc5d19a" title="Convert 24-bits per pixel RGB data to 32-bits per pixel RGBA data.">RGBToRGBA</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* rgbData, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* rgbaData, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height);</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="image_8cpp.html#a872cec0732df69b80796a61acea716f0" title="Convert 32-bits per pixel RGBA data to 24-bits per pixel RGB data.">RGBAToRGB</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* rgbaData, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* rgbData, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height);</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="image_8h.html">image.h</a></li>
    <li class="footer">
        <a href="http://www.arm.com/">(C) ARM Ltd. 2013</a>
    </li>
  </ul>
</div>
</body>
</html>
